<template>
  <div class="gameIcon">
    <div class="flex">
      <el-tag size="small" :type="!indexStore.is_general_agent && selectToLabel(indexStore.gameArray,props.game_id,'game_source','value')?'danger':'success'">{{ GamePlatform(props.game_id) }}</el-tag>
      <img class="icon" :src="selectToLabel(GAMEICON,props.game_id)" alt="">
    </div>
    <p class="text-cut">{{ selectToLabel(indexStore.gameArray,props.game_id) }}</p>
  </div>
</template>

<script lang="ts" setup>
import { selectToLabel, GamePlatform } from '@/utils/index'
import { GAMEICON } from '@/config/eunm'

import { useStore } from '@/stores/index'
const indexStore = useStore()

const props = defineProps({
  game_id: {
    type: Number,
    default: () => {
      return 0
    }
  },
})

</script>

<style lang="scss" scoped>
// 游戏图标
.gameIcon {
  display: flex;
  align-items: center;
  .icon{
    width: 30px;
    border-radius: 50%;
    margin:0 3px;
  }
  div{
    &:first-child{
      text-align: right;
    }
    .el-tag{
      width: 50px;
    }
  }
}
</style>
